﻿//文件指定编译编码UTF-8
#pragma execution_character_set("utf-8")

/**
*
* @file:    role.h
* @brief:
* @author:  sanshi522@163.com
* @date:    2024-11-05  11:38
*
*
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License along
*  with this program; if not, write to the Free Software Foundation, Inc.,
*  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/

#ifndef ROLE_H
#define ROLE_H
#include "qbaseentity.h"
/**
 * @brief 角色实体类
 */
class Role: public QBaseEntity
{
    Q_OBJECT
    // 使用 Q_PROPERTY 宏定义属性
    Q_PROPERTY(uint64_t id READ getId WRITE setId)
    Q_PROPERTY(QString name READ getName WRITE setName)
    Q_PROPERTY(QString code READ getCode WRITE setCode)
    Q_PROPERTY(QString description READ getDescription WRITE setDescription)
    Q_PROPERTY(QStringList authoritys READ getAuthoritys WRITE setAuthoritys)
    Q_PROPERTY(int status READ getStatus WRITE setStatus)
public:
    Role(QObject *parent = nullptr);
    ~Role();

    // 直接使用基类的方法来访问createTime和updateTime
    using QBaseEntity::getCreateTime;
    using QBaseEntity::setCreateTime;
    using QBaseEntity::getUpdateTime;
    using QBaseEntity::setUpdateTime;

    uint64_t getId() const;
    void setId(const uint64_t &value);

    QString getName() const;
    void setName(const QString &value);

    QString getCode() const;
    void setCode(const QString &value);

    QString getDescription() const;
    void setDescription(const QString &value);

    QStringList getAuthoritys() const;
    void setAuthoritys(const QStringList &value);

    int getStatus() const;
    void setStatus(int value);

private:
    uint64_t id; /**< 角色ID */
    QString name; /**< 角色名称（中文）*/
    QString code; /**< 角色代码（英文）*/
    QString description;/**< 角色描述信息 */
    QStringList authoritys; /**< 角色权限列表*/
    int status;/**< 状态*/
};

#endif // ROLE_H
